﻿#region Copyright 2011 Mike Goatly
// This source is subject to the the MIT License (MIT)
// All rights reserved.
#endregion

namespace Lifti.Extensibility
{
    using System;

    /// <summary>
    /// Event arguments that contain a exception information relating to the rollback of a transaction.
    /// </summary>
    public class TransactionRollbackEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TransactionRollbackEventArgs"/> class.
        /// </summary>
        /// <param name="exception">The exception that caused the rollback, if any.</param>
        public TransactionRollbackEventArgs(Exception exception)
        {
            this.Exception = exception;
        }

        /// <summary>
        /// Gets or sets the exception that caused the rollback.
        /// </summary>
        /// <remarks>This will only be set if an exception was thrown during the commit or rollback phase. If the
        /// exception was raised outside of the index code (i.e. in user code within the transaction) then this
        /// will be null.</remarks>
        /// <value>
        /// The associated exception.
        /// </value>
        public Exception Exception
        {
            get;
            set;
        }
    }
}